package com.olympus.hermes.product.bean.dto.brand;

import com.olympus.hermes.common.bean.AbstractBeanConvert;
import com.olympus.hermes.product.domain.Brand;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;


/**
 * @author Mickey
 * @since 2021/1/20
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class CreateBrandDTO extends AbstractBeanConvert<CreateBrandDTO, Brand> {

    @NotBlank
    private String name;

    private String logo;

    private String description;

    private Integer showStatus;

    private String firstLetter;

    private Integer sort;

    @Override
    protected Brand doForward(CreateBrandDTO createBrandDTO) {
        Brand brand = new Brand();
        brand.setDescription(createBrandDTO.getDescription());
        brand.setName(createBrandDTO.getName());
        brand.setLogo(createBrandDTO.getLogo());
        brand.setSort(createBrandDTO.getSort());
        return brand;
    }

    @Override
    protected CreateBrandDTO doBackward(Brand brand) {
        return null;
    }
}
